import request from '@/utils/request'
// 货主
export function ownerPage(params) {
  return request({
    url: '/api/owner/page',
    method: 'get',
    params
  })
}
export function editOwner(data) {
  return request({
    url: '/api/owner',
    method: 'PUT',
    data
  })
}
export function delOwner(id) {
  return request({
    url: `/api/owner?ids[]=${id}`,
    method: 'DELETE'
  })
}
export function addOwner(data) {
  return request({
    url: '/api/owner',
    method: 'POST',
    data
  })
}
export function searchOwner(id) {
  return request({
    url: `/api/owner/${id}`,
    method: 'GET'
  })
}
export function owneDetail(id) {
  return request({
    url: `/api/owner/detail/${id}`,
    method: 'GET'
  })
}
// 分页查询货主-库位关联表 详细
export function ownerLocation(params) {
  return request({
    url: '/api/ownerLocation/pageDetail',
    method: 'get',
    params
  })
}
// 查询库区库位树
export function areaTree(params) {
  return request({
    url: `/api/area/tree`,
    method: 'GET',
    params
  })
}
/*
idStrArray 仓库，库区，库位 id集合
**/
// 货主批量关联库位
export function batchOwner(data) {
  return request({
    url: '/api/ownerLocation/batch',
    method: 'POST',
    data
  })
}
// 删除货主-库位关联表
export function delOwnerLocation(id) {
  return request({
    url: `/api/ownerLocation?${id}`,
    method: 'DELETE'
  })
}
// 分页查询承运商
export function carrierPage(params) {
  return request({
    url: '/api/carrier/page',
    method: 'get',
    params
  })
}
